package com.jinduplan.planmanager.widgets

import android.annotation.SuppressLint
import android.content.Context
import androidx.recyclerview.widget.GridLayoutManager
import com.cxz.kotlin.baselibs.adapter.CustomRecyclerAdapter
import com.cxz.kotlin.baselibs.adapter.ViewHolder
import com.cxz.kotlin.baselibs.base.MyBaseDialog
import com.cxz.kotlin.baselibs.utils.RxTimerUtil
import com.jinduplan.planmanager.R
import com.jinduplan.planmanager.utils.ResUtil
import kotlinx.android.synthetic.main.dialog_cancel_comfir.*
import kotlinx.android.synthetic.main.dialog_cancel_comfir.btnCancel
import kotlinx.android.synthetic.main.dialog_cancel_comfir.btnComfir
import kotlinx.android.synthetic.main.dialog_cancel_comfir.tvTitle
import kotlinx.android.synthetic.main.dialog_input.*

class InputDialog(context: Context) : MyBaseDialog(context) {


    override fun getContentId(): Int {
        return R.layout.dialog_input
    }



    @SuppressLint("SetTextI18n")
    override fun init() {
        setCanceledOnTouchOutside(false)
        setCancelable(false)
    }

    fun setContent(title:String,comfirFun:(content:String)->Unit = {}): InputDialog {

        tvTitle.setText(title)
        btnComfir.setOnClickListener {
            comfirFun(etInput.text.toString())
            dismiss()
        }
        btnCancel.setOnClickListener {
            dismiss()
        }
        return this
    }

}